package com.ruoyi.factory.erp.controller;

import com.ruoyi.factory.erp.service.ErpHandleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ErpHandleController
 * @Description: TODO erp业务处理类
 * @Author LiuJiaji
 * @Date 2023/10/8 10:01
 **/
@EnableScheduling
@RestController("erpHandleController")
@RequestMapping("/api/erpHandleCon")
public class ErpHandleController {

    @Autowired
    private ErpHandleService erpHandleService;

    /**
     * @author: Liujiaji
     * @date: 2023/10/8 10:06
     * @description: TODO 信息处理 客户物料编码code为1同步为 标准规格
     * @param: []
     * @return: void
     **/
    @Scheduled(cron="5 5 0/1 1 1 ?")
    public void ggtocode (){
        erpHandleService.ggtocode();
    }


    //付款单 在某种状态定时查询推送回写 根据支付时间查询近两天的
    /**
     * @author: LiuJiaji
     * @date:  16:29
     * @description: TODO 通知付款单制单人员已付款
     * @param:
     * @return:
     **/
    @PostMapping("/fkdpushmessage")
    public void fkdpushmessage(){
        erpHandleService.fkdpushmessage();
    }

    //资金付款单 在某种状态定时查询推送回写 根据支付时间查询近两天的
    /**
     * @author: LiuJiaji
     * @date:  16:29
     * @description: TODO 通知资金付款单制单人员已付款
     * @param:
     * @return:
     **/
    @PostMapping("/zjfkdpushmessage")
    public void zjfkdpushmessage(){
        erpHandleService.zjfkdpushmessage();
    }

    /**
     * @author: LiuJiaji
     * @date: 2025/10/28 10:51
     * @description: TODO 通知付款单制单人员已付款 定时任务
     * @param:
     * @return:
     **/
    @Scheduled(cron="0 0 15 * * ?")
    public void fkdpushmessage2(){
        erpHandleService.fkdpushmessage();
    }

    /**
     * @author: LiuJiaji
     * @date: 2025/10/28 10:51
     * @description: TODO 通知资金付款单制单人员已付款 定时任务
     * @param:
     * @return:
     **/
    @Scheduled(cron="0 5 15 * * ?")
    public void zjfkdpushmessage2(){
        erpHandleService.zjfkdpushmessage();
    }



}
